home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 2.0 KB | 69 lines | [TEXT/MPS ] |
- // The C++ Booch Components (Version 2.1)
- // (C) Copyright 1990-1993 Grady Booch. All Rights Reserved.
- //
- // BCCollD.h
- //
- // This file contains the declaration of the dynamic collection.
-
- #ifndef BCCOLLD_H
- #define BCCOLLD_H 1
-
- #include "BCDynami.h"
- #include "BCColl.h"
-
- // Dynamic collection
-
- template<class Item, class StorageManager>
- class BC_TDynamicCollection : public BC_TCollection<Item> {
- public:
-
- BC_TDynamicCollection();
- BC_TDynamicCollection(BC_Index chunkSize);
- BC_TDynamicCollection(const BC_TDynamicCollection<Item, StorageManager>&);
- virtual ~BC_TDynamicCollection();
-
- virtual BC_TCollection<Item>& operator=(const BC_TCollection<Item>&);
- virtual BC_TCollection<Item>&
- operator=(const BC_TDynamicCollection<Item, StorageManager>&);
- virtual BC_Boolean operator==(const BC_TCollection<Item>&) const;
- virtual BC_Boolean
- operator==(const BC_TDynamicCollection<Item, StorageManager>&) const;
- BC_Boolean operator!=(const BC_TDynamicCollection<Item, StorageManager>&) const;
- virtual const Item& operator[](BC_Index) const;
- virtual Item& operator[](BC_Index);
-
- virtual void SetChunkSize(BC_Index chunkSize);
- virtual void Preallocate(BC_Index new_length);
- virtual void Clear();
- virtual void Insert(const Item&);
- virtual void Insert(const Item&, BC_Index before);
- virtual void Append(const Item&);
- virtual void Append(const Item&, BC_Index after);
- virtual void Remove(BC_Index at);
- virtual void Replace(BC_Index at, const Item&);
-
- virtual BC_Index ChunkSize() const;
- virtual BC_Index Length() const;
- virtual BC_Boolean IsEmpty() const;
- virtual const Item& First() const;
- virtual Item& First();
- virtual const Item& Last() const;
- virtual Item& Last();
- virtual BC_ExtendedIndex Location(const Item&) const;
-
- static void* operator new(size_t);
- static void operator delete(void*, size_t);
-
- protected:
-
- BC_TDynamic<Item, StorageManager> fRep;
-
- virtual void Purge();
- virtual void Add(const Item&);
- virtual BC_Index Cardinality() const;
- virtual const Item& ItemAt(BC_Index) const;
-
- };
-
- #endif
-